package com.zt.ztzx.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zt.ztzx.model.entity.device.Device;
import com.zt.ztzx.model.vo.DeviceVo;
import com.zt.ztzx.model.vo.common.Result;
import com.zt.ztzx.service.DeviceService;
import com.zt.ztzx.mapper.DeviceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 16236
* @description 针对表【t_device】的数据库操作Service实现
* @createDate 2024-09-11 09:22:24
*/
@Service
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device>
    implements DeviceService{

    @Autowired
    private DeviceMapper deviceMapper;

    /**
     * 查询设备列表
     * @param tid
     * @param pageNum
     * @param pageSize
     * @return
     */
    @Override
    public Result<PageInfo<DeviceVo>> getDeviceList(Integer tid, Integer pageNum,Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<DeviceVo> list =  deviceMapper.selectAll(tid);
        PageInfo<DeviceVo> pageInfo = new PageInfo<>(list);
        return Result.build(pageInfo,200,"查询成功");
    }
}




